#ifndef __losor_object_h__
#define __losor_object_h__

#include <list>
#include <string>

namespace losor
{
	class object
	{
		public:
			virtual long parse( string para, object *parent ) = 0;
			virtual long write_depend( object *parent ) = 0;
			virtual void rm_child( string para ) = 0;
		public:
			object( string type, string caption, object *parent );
			virtual ~object();
		public:
			const list<object*>& get_child() const;
			const list<object*>& get_ref() const;
			const list<object*>& get_beref() const;
			string get_type() const;
			string get_caption() const;
		protected:
			virtual void add_child( object *child );
			virtual void add_ref_obj( object* ref );
			virtual void add_beref_obj( object *beref );
			virtual void rm_child( object *child );
			virtual void rm_ref( object *ref );
			virtual void rm_beref( object *beref );
			virtual void reset( string type, string caption, object *parent );
		protected:
			object *m_parent;
			list<object*> m_child;
			string m_type;
			string m_caption;
			list<object*> m_ref;
			list<object*> m_beref;
	};
}

#endif

